import { gfRequest } from "../../utils/gfRequest";

const state = {
	searchText: "",
	searchMusicList: []
};

const getters = {};

const actions = {
	async getMusicList({ commit }, data) {
		const response = await gfRequest(data);
		commit("GETMUSICLIST", response.data.result.songs);
	}
};

const mutations = {
	UPDATESEARCHTEXT(state, data) {
		state.searchText = data;
	},
	GETMUSICLIST(state, data) {
		state.searchMusicList = data;
	}
};

export default {
	namespaced: true,
	state,
	getters,
	actions,
	mutations
};
